<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"
          name="viewport">
    <meta content="ie=edge" http-equiv="X-UA-Compatible">
    <title>Document</title>
</head>
<body>
<div id="root">

</div>
<script>
    let year = prompt("请输入年份") * 1
    let month = prompt("请输入月份") * 1

    switch (true) {
        case month === 1:
        case month === 3:
        case month === 5:
        case month === 7:
        case month === 8:
        case month === 10:
        case month === 12:
            alert("31天");
            break;
        case month === 4:
        case month === 6:
        case month === 9:
        case month === 11:
            alert("30天");
            break
        default:
            if ((year % 4 && year % 100 !== 0) || year % 400)
                alert("29天")
            else
                alert("28天")
    }
</script>

</body>
</html>